package view.menus;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import controller.CustomEvent;
import controller.EventHandler;
import controller.MenuEventHandler;
/** * A class to encapsulate the help menu on the designer * @author Daniel Bond, Mohammed Abdullah, Gideon Pyzer * */
@SuppressWarnings("serial")
public class HelpMenu extends JMenu{

	private JMenuItem mHelpAbout;
	private EventHandler eventHandler;
	public HelpMenu(){
	
		super("Help");
		mHelpAbout = new JMenuItem("About");
		eventHandler = new MenuEventHandler();
		buildMenu();
		//Show the about dialog
		mHelpAbout.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				CustomEvent event = new CustomEvent("about");
				HelpMenu.this.eventHandler.createEvent(event);
			}
		});
	}	/**	 * Adds the components to the menu	 */
	private void buildMenu(){
		this.add(mHelpAbout);
	}
}